/** react-native-ble-manager事件 */
export enum BleEventType {
  /** 扫描结束监听 */
  BleManagerStopScan = 'BleManagerStopScan',
  /** 扫描到一个新设备 */
  BleManagerDiscoverPeripheral = 'BleManagerDiscoverPeripheral',
  /** 蓝牙状态改变 */
  BleManagerDidUpdateState = 'BleManagerDidUpdateState',
  /** 接收到新数据 */
  BleManagerDidUpdateValueForCharacteristic = 'BleManagerDidUpdateValueForCharacteristic',
  /** 蓝牙设备已连接 */
  BleManagerConnectPeripheral = 'BleManagerConnectPeripheral',
  /** 蓝牙设备已断开连接 */
  BleManagerDisconnectPeripheral = 'BleManagerDisconnectPeripheral',
  /** [iOS only] 在centralManager:WillRestoreState:被调用时触发（应用程序在后台重新启动以处理蓝牙事件） */
  BleManagerCentralManagerWillRestoreState = 'BleManagerCentralManagerWillRestoreState',
  /** [iOS only] 外围设备收到了开始或停止为指定特征值提供通知的请求 */
  BleManagerDidUpdateNotificationStateFor = 'BleManagerDidUpdateNotificationStateFor',
}

export enum BleState {
  Unknown = 'unknown', // [iOS only]
  Resetting = 'resetting', // [iOS only]
  Unsupported = 'unsupported',
  Unauthorized = 'unauthorized', // [iOS only]
  On = 'on',
  Off = 'off',
  TurningOn = 'turning_on', // [android only]
  TurningOff = 'turning_off', // [android only]
}

export const ErrorArr = [
  'V5Err',
  'V12Err',
  'V15Err',
  'CurADInitErr',
  'CurOC',
  'PDriveFail',
  'DCHH',
  'DCLL',
  'SpeedHH',
  'MotorBlock',
  'MosTmpHDeratingWarn',
  'MotorTmpHDeratingWarn',
  'BkErr',
  'Rsv2',
  'CurLoopFail',
  'ACCErr',
  'AccInitErr',
  'ANGLELos',
  'MotPhaseLos',
  'AngleSuddenChange',
  'AngleZeroBlock',
  'ErrLevel1',
  'ErrLevel2',
  'ErrLevel3',
  'BMSBusoff',
  'BMSFltLevel3',
  'OBCBusoff',
  'DCDCBusoff',
  'ACCMBusoff',
  'ABSBusoff',
  'CNSBusoff',
  'ParaFlash1Err',
  'ParaFlash2Err',
  'ParaFlash1EmptyChip',
  'ParaFlash2EmptyChip'
];

export const tcType = [
  [0, 1, 3, 5, 7, 11, 16, 23, 31, 40, 55, 76, 92, 100, 100, 100],
  [0, 1, 4, 6, 9, 13, 19, 26, 34, 42, 57, 76, 93, 100, 100, 100],
  [0, 2, 5, 8, 11, 16, 22, 29, 37, 45, 59, 77, 94, 100, 100, 100],
  [0, 3, 6, 10, 14, 19, 25, 32, 40, 48, 61, 78, 94, 100, 100, 100],
  [0, 3, 7, 12, 16, 22, 28, 35, 43, 51, 63, 79, 95, 100, 100, 100],
  [0, 4, 9, 14, 18, 24, 31, 38, 46, 54, 66, 80, 95, 100, 100, 100],
  [0, 5, 10, 15, 21, 27, 34, 41, 49, 57, 68, 81, 96, 100, 100, 100],
  [0, 5, 11, 17, 23, 30, 37, 44, 52, 60, 70, 82, 96, 100, 100, 100],
  [0, 6, 12, 19, 26, 33, 40, 47, 55, 63, 72, 82, 97, 100, 100, 100],
  [0, 7, 14, 21, 28, 35, 43, 50, 58, 66, 74, 83, 97, 100, 100, 100],
  [0, 7, 15, 23, 30, 38, 46, 53, 61, 69, 77, 86, 98, 100, 100, 100],
  [0, 7, 15, 23, 30, 38, 46, 53, 61, 69, 78, 88, 99, 100, 100, 100],
  [0, 8, 16, 24, 33, 41, 49, 56, 64, 72, 80, 91, 99, 100, 100, 100],
  [0, 9, 17, 26, 35, 44, 52, 60, 67, 75, 83, 92, 99, 100, 100, 100],
  [0, 9, 19, 28, 37, 46, 55, 63, 70, 78, 86, 93, 99, 100, 100, 100],
  [0, 10, 20, 30, 40, 49, 58, 66, 73, 81, 87, 93, 99, 100, 100, 100],
  [0, 11, 21, 32, 42, 52, 61, 69, 76, 83, 88, 94, 99, 100, 100, 100],
  [0, 11, 22, 33, 45, 55, 64, 72, 79, 86, 90, 95, 99, 100, 100, 100],
  [0, 12, 24, 35, 47, 57, 67, 75, 83, 89, 92, 97, 99, 100, 100, 100],
  [0, 13, 25, 37, 49, 60, 70, 78, 86, 92, 96, 98, 99, 100, 100, 100],
  [0, 13, 26, 39, 52, 63, 73, 81, 89, 93, 97, 98, 99, 100, 100, 100],
];
